Repository navigation
Move to Polhem.JsonRpc 1.4.0 and refuse streaming methods in PolhemMethodPolicy - #644
Merged
Merged
Conversation
…thodPolicy The pin in PolhemJsonRpc.props, the project templates and the install commands of the READMEs and getting-started documents move from 1.2.0 to 1.4.0. Since 1.3.0 the dispatcher also resolves a method whose second parameter is an IJsonRpcStream<T> and leaves it to the method policy. PolhemMethodPolicy looked only for ApiAccessControlAttribute, so a business object declared at class level would publish such a method, and its items would leave without ApiOutputConverter. The policy now admits methods with one parameter only; PolhemMethodPolicyTests covers both the method-level and the class-level declaration. The POLHEM3001 analyzer, ActionPayloadType and the security rule describe the narrowing instead of crediting IsResolvableAction alone.
…the Api.Server README describe what an action reaches
jeff377
enabled auto-merge
December 2, 2026 07:12
This was referenced Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the framework from Polhem.JsonRpc 1.2.0 to 1.4.0 (release notes).
Version
PolhemJsonRpc.propspins[1.4.0]. The two project templates and thedotnet add packagelines ofREADME,README.zh-TWand both getting-started documents follow;TemplateJsonRpcVersionTestschecks that they agree.PolhemMethodPolicy refuses streaming methods
Since 1.3.0 the dispatcher's
JsonRpcMethod.IsResolvableActionalso resolves a method whose second parameter is anIJsonRpcStream<T>, and leaves the decision to the method policy.PolhemMethodPolicylooked only forApiAccessControlAttribute, so on a business object declared at class level such a method would become an action, and its items would leave withoutApiOutputConverter, whichPolhemPayloadFilterapplies to the return value only. No business object has one today. The policy now admits methods with one parameter only.PolhemMethodPolicyTests: a streaming method is refused whether it declares its access itself or through its class. Removing the parameter check turns both cases red.ActionPayloadType.Resolveand.claude/rules/security.mdcreditedIsResolvableActionalone with the one-parameter shape; they now name the policy.What else 1.3.0 and 1.4.0 change, checked against the framework
Acceptnamestext/event-streamis treated as streamed.RemoteApiProviderand its header handler set noAccept, polhem-connector-js sends none, and*/*does not count, so deployed clients are not affected.PayloadConnector.InvokeAsyncwithout a result type now verifies the result;ApiConnectorusesInvokeAsync<object>only.rpcis no longer found; the framework has none.Checks
dotnet build Polhem.slnx -c Release --no-incrementalagainst the published 1.4.0 packages: succeeded.dotnet test Polhem.slnx: everything passes except four tests that fail onmainas well on this machine:DbAccessCompanyBindingTests(two) andBusinessObjectPropertyTests.ResolveDatabaseId_CommonScope_ReturnsNonEmptyDatabaseId(no connection string forcommon), andPolhemAvaloniaTemplateTests.Generate_iOS_Builds(MT7199 from the local iOS SDK).check-xmldoc-refs.sh,check-md-links.sh: passed.The release notes of the next framework version should list the move to 1.4.0.